
<script language='javascript'>var showAll=false;</script>
<?php

require_once("../../controllers/init.php");
require_once($FILE_SYSTEM_ROOT."/controllers/authentication.php");

/*$choir="all";
if($_POST['choir']=="music-choir-menu-button-showboys")
	$choir="boys";
elseif($_POST['choir']=="music-choir-menu-button-showgirls")
	$choir="girls";
elseif($_POST['choir']=="music-choir-menu-button-showclerks")
	$choir="clerks";
*/
$events = new EventsResultSet();

if(isset($_POST['from'])) 
{
	$events->setFrom(new DateTime($_POST['from']));
}
else 
{
	$events->setFrom(new DateTime('now'));
}
//$time = new DateTime($_POST['from']);
//echo $time->format("j M Y")."<br/n";

$eventsArray = $events->getEvents();
//print_r($eventsArray);

foreach ($eventsArray as $event)
{
	print "<div class=\"events-table\" id=\"music-event-".$event->getEventID()."\">";
	
	print "<div class=\"events-table-musiclist\">";
	print "<form method=\"get\" action=\"\">";
	$musicList=($event->getMusicList())?"checked":"";
	print "<input id=\"music-check-".$event->getEventID()."\" type=\"checkbox\" ".$musicList." class=\"music-list-event-checkbox\">Music list&nbsp&nbsp</input>";
	print "</form>";

	print "<form method=\"get\" action=\"\">";
	$musicLive=($event->getMusicLive())?"checked":"";
	print "<input id=\"music-check-live-".$event->getEventID()."\" type=\"checkbox\" ".$musicLive." class=\"music-live-event-checkbox\">Live</input>";
	print "</form></div>";
	print "<div class=\"events-table-day\">".$event->getStart()->format("D")."</div>";
	print "<div class=\"events-table-date\">".$event->getStart()->format("j M Y")."</div>";
	print "<div class=\"events-table-time\">".$event->getStart()->format("H:i")."</div>";
	print "<div class=\"events-table-time\">".$event->getTitle()."</div>";
	//	print "<div class=\"musiclist-table-edatetime\">".$musicEvent->geteDateTime()->format("j M Y")."</div>";
	
	print "</div>";
}

?>
